﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TJ_JZCSModeWebForm.aspx.cs" Inherits="Anke.SHManage.Web.Reports.TJ_JZCSModeWebForm" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><%=Title%></title>
    <script src="../Content/EasyUI/jquery.js"></script>
    <script src="../Content/EasyUI/jquery.easyui.js"></script>
    <script src="../Content/EasyUI/locale/easyui-lang-zh_CN.js"></script>
    <link href="../Content/EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="../Content/EasyUI/themes/default/easyui.css" rel="stylesheet" />
    <script src="../Scripts/jquery.AnkeExtend.js"></script>
    <script type="text/javascript">
        //页面加载
        $(document).ready(function () {
            DisableBackspace();
            reload();
        });
        function fillCombobox() {

            //取所属分中心的下拉框的值
            $("#Center").combobox({
                url: "../BB/AllDictionary/GetCenterName",
                valueField: 'ID',
                textField: 'Name',
                editable: false,
                multiple: true,
                prompt: '--请选择--',
                onSelect: function (rec) {
                    var ids = $('#Center').combobox('getValues');
                    //根据分中心取分站
                    $("#Station").combobox({
                        url: "../BB/AllDictionary/GetSationName?centerID=" + ids,
                        method: 'POST',
                        valueField: 'ID',
                        textField: 'Name',
                        multiple: true,
                        editable: false,
                        onSelect: function () {
                            $('#Station').combobox('getValues')
                        },
                        onUnselect: function () {
                            $('#Station').combobox('getValues')
                        }
                    });
                    $("#Station").combobox('clear');
                },
                onUnselect: function (rec) {
                    var ids = $('#Center').combobox('getValues');
                    //根据分中心取分站
                    $("#Station").combobox({
                        url: "../BB/AllDictionary/GetSationName?centerID=" + ids,
                        method: 'POST',
                        valueField: 'ID',
                        textField: 'Name',
                        multiple: true,
                        editable: false
                        //onSelect: function () {
                        //    //$('#Station').combobox('getValues')
                        //},
                        //onUnselect: function () {
                        //    $('#Station').combobox('getValues')
                        //}
                    });
                    // $("#Station").combobox('setValues', '');
                    $("#Station").combobox('clear');
                },
            });

            var centers = $('#Center').combobox('getValues');
            $("#Station").combobox({
                url: "../BB/AllDictionary/GetSationName?centerID=" + centers,
                method: 'POST',
                valueField: 'ID',
                textField: 'Name',
                multiple: true,
                editable: false,
                onSelect: function () {
                    $('#Station').combobox('getValues')
                },
                onUnselect: function () {
                    $('#Station').combobox('getValues')
                }
            });

            //取事件类型           
            var urlstr = "../BB/AllDictionary/GetPatientVersion";
            $.EUIcomboboxForReport("#txtPatientVersion", {
                url: urlstr,
                valueField: 'Name',
                textField: 'Name',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]

            });

            //病种分类
            var urlstr = "../BB/AllDictionary/GetDiseasesClassifications";
            $.EUIcomboboxForReport("#txtDiseasesClassification", {
                url: urlstr,
                valueField: 'Name',
                textField: 'Name',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]


            });
            //病情类型
            var urlstr = "../BB/AllDictionary/GetIllnessClassification";
            $.EUIcomboboxForReport("#txtIllnessClassification", {
                url: urlstr,
                valueField: 'Name',
                textField: 'Name',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]

            });

            //急救效果
            var urlstr = "../BB/AllDictionary/GetFirstAidEffect";
            $.EUIcomboboxForReport("#txtFirstAidEffect", {
                url: urlstr,
                valueField: 'Name',
                textField: 'Name',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]

            });

            //病情预报
            var urlstr = "../BB/AllDictionary/GetIllnessForecast";
            $.EUIcomboboxForReport("#txtIllnessForecast", {
                url: urlstr,
                valueField: 'Name',
                textField: 'Name',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]

            });

            //死亡类型
            var urlstr = "../BB/AllDictionary/GetDeathCase";
            $.EUIcomboboxForReport("#txtDeathCase", {
                url: urlstr,
                valueField: 'Name',
                textField: 'Name',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]
            });
            
            //心肺复苏是否成功
            $('#Rosc').combobox({
                valueField: 'ID',
                textField: 'Name',
                method: 'get',
                editable: false,
                panelHeight: 'auto',
                data: [
                {
                    ID: '-1',
                    Name: '--请选择--',
                },
                {
                    ID: 'ROSC',
                    Name: '是'
                },
                {
                    ID: '',
                    Name: '否'
                }
                ],
                onSelect: function () {
                    $('#HiddenForRosc').val($('#Rosc').combobox('getValue'));
                },
                onLoadSuccess: function () {
                    var dataz = $('#Rosc').combobox('getData');
                    $("#Rosc").combobox('select', dataz[0].ID);
                }

            });
            
            //告知签字
            $('#FormedConsent').combobox({
                valueField: 'ID',
                textField: 'Name',
                method: 'post',
                editable: false,
                panelHeight: 'auto',
                data: [
                {
                    ID: '-1',
                    Name: '--请选择--',
                },
                {
                    ID: '1',
                    Name: '是'
                },
                {
                    ID: '0',
                    Name: '否'
                }
                ],
                onSelect: function () {
                    $('#HiddenForFormedConsent').val($('#FormedConsent').combobox('getValue'));
                },
                onLoadSuccess: function () {
                    var dataz = $('#FormedConsent').combobox('getData');
                    $("#FormedConsent").combobox('select', dataz[0].ID);
                }
            })
            
        //更改时间
        $('#Time').combobox({
            valueField: 'ID',
            textField: 'Name',
            method: 'post',
            editable: false,
            panelHeight: 'auto',
            data: [
            {
                ID: '-1',
                Name: '--请选择--',
            },
            {
                ID: '1',
                Name: '出车时间'
            },
            {
                ID: '2',
                Name: '到达现场时间'
            },
            {
                ID: '3',
                Name: '离开时间'
            },
            {
                ID: '4',
                Name: '到院时间'
            }
            ],
            onSelect: function () {
                $('#HiddenForTime').val($('#Time').combobox('getValue'));
            },
            onLoadSuccess: function () {
                var dataz = $('#Time').combobox('getData');
                $("#Time").combobox('select', dataz[0].ID);
            }
        })
           
        //更改原因
        $('#Reason').combobox({
            valueField: 'ID',
            textField: 'Name',
            method: 'post',
            editable: false,
            panelHeight: 'auto',
            data: [
            {
                ID: '-1',
                Name: '--请选择--',
            },
            {
                ID: '1',
                Name: '车到未送'
            },
            {
                ID: '2',
                Name: '设备故障'
            },
            {
                ID: '3',
                Name: '网络问题'
            },
            {
                ID: '4',
                Name: 'GPS误按'
            },
            {
                ID: '5',
                Name: '一车多人'
            },
            {
                ID: '6',
                Name: '其他'
            }
            ],
            onSelect: function () {
                $('#HiddenForReason').val($('#Reason').combobox('getValue'));
            },
            onLoadSuccess: function () {
                var dataz = $('#Reason').combobox('getData');
                $("#Reason").combobox('select', dataz[0].ID);
            }
        })
        //选择姓名联动工号
        $.EUIcombobox('#txtDoctorAndNurse', {
            //prompt: '--请选择--',
            url: '../CM/CardInfo/GetNames/',//ajax后台取数据路径，返回的是json格式的数据
            valueField: 'ID',
            textField: 'Name',
            editable: true,
            method: 'POST',
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }],
            onSelect: function (rec) {
                $('#txtAgentWorkID').combobox({
                    type: 'POST',
                    url: '../CM/CardInfo/GetWorkIDs?name=' + encodeURI(rec.ID), //根据姓名取到相应的工号
                    dataType: "json",
                    onSelect: function () {
                        $('#txtAgentWorkID').combobox('getValue')
                    }
                });
            }
           
        });
        //取工号
        $.EUIcombobox("#txtAgentWorkID", {
            url: '../CM/CardInfo/GetWorkCode/',
            valueField: 'ID',
            textField: 'Name',
            editable: true,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]
        });
        };     
        // 实现UpdatePanel中可以再添加easyUI的样式
        function reload() {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        }
        function EndRequestHandler() {
            fillCombobox();
            $('#StartDate').datetimebox();
            $('#EndDate').datetimebox();
            //$('#txtAgentWorkID').textbox();
            //$('#txtDoctorAndNurse').textbox();
            $('#txtMeasures').textbox();
            $('#txtFirstImpression').textbox();
            $('#txtSendAddress').textbox();
            
        }

    </script>
</head>
<body>

    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <table>
                    <tr>
                        <td>查询时间：</td>
                        <td>
                            <asp:TextBox ID="StartDate" class="easyui-datetimebox" Style="width: 150px" runat="server" editable="false"></asp:TextBox>
                        </td>
                        <td style="text-align: center">至</td>
                        <td>
                            <asp:TextBox ID="EndDate" class="easyui-datetimebox" Style="width: 150px" runat="server" editable="false"></asp:TextBox>
                        </td>
                        <td>人员工号：</td>
                        <td>
                            <asp:TextBox ID="txtAgentWorkID" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                        <td>人员姓名：</td>
                        <td>
                            <asp:TextBox ID="txtDoctorAndNurse" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>

                        <td style="text-align: right">事件类型：</td>
                        <td>
                            <asp:TextBox ID="txtPatientVersion" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">分中心：</td>
                        <td>
                            <asp:TextBox ID="Center" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                            <%--<asp:DropDownList ID="DropDownList_Center" runat="server" Width="150px" AutoPostBack="True" OnSelectedIndexChanged="DropDownList_Center_SelectedIndexChanged"></asp:DropDownList>--%>
                        </td>
                        <td style="text-align: right">分站：</td>
                        <td>
                            <asp:TextBox ID="Station" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                            <%--<asp:DropDownList ID="DropDownList_Station" runat="server" Width="150px" AutoPostBack="True"></asp:DropDownList>--%>
                        </td>
                        <td style="text-align: right">病种分类：</td>
                        <td>
                            <asp:TextBox ID="txtDiseasesClassification" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                        <td style="text-align: right">病情类型：</td>
                        <td>
                            <asp:TextBox ID="txtIllnessClassification" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                        <td style="text-align: right">呼吸心跳停止类型：</td>
                        <td>
                            <asp:TextBox ID="txtDeathCase" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">救治措施：</td>
                        <td>
                            <asp:TextBox ID="txtMeasures" class="easyui-textbox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                        <td style="text-align: right">急救效果：</td>
                        <td>
                            <asp:TextBox ID="txtFirstAidEffect" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                        <td style="text-align: right">诊断：</td>
                        <td>
                            <asp:TextBox ID="txtFirstImpression" class="easyui-textbox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                        <td style="text-align: right">送往地点：</td>
                        <td>
                            <asp:TextBox ID="txtSendAddress" class="easyui-textbox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                         <td style="text-align: right">心肺复苏：</td>
                        <td>
                            <asp:HiddenField ID="HiddenForRosc" runat="server" />
                        <select id="Rosc" class="easyui-combobox" style="width: 150px" data-options="editable:false">
                      <%--  <option value="-1">--请选择--</option> 
                        <option value="ROSC">是</option> 
                        <option value="">否</option>  --%> 
                        </select>                                                       
                        </td>                       
                    </tr>
                    <tr>
                        <td style="text-align: right">病情预报：</td>
                        <td>
                            <asp:TextBox ID="txtIllnessForecast" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                        </td>
                         <td style="text-align: right">告知签字：</td>
                        <td>
                            <asp:HiddenField ID="HiddenForFormedConsent" runat="server" />
                        <select id="FormedConsent" class="easyui-combobox" style="width: 150px" data-options="editable:false">                                                 
                        </select>                                                       
                        </td>
                         <td style="text-align: right">时间：</td>
                        <td>
                            <asp:HiddenField ID="HiddenForTime" runat="server" />
                        <select id="Time" class="easyui-combobox" style="width: 150px" data-options="editable:false">                                                 
                        </select>                                                       
                        </td>
                         <td style="text-align: right">更改原因：</td>
                        <td>
                            <asp:HiddenField ID="HiddenForReason" runat="server" />
                        <select id="Reason" class="easyui-combobox" style="width: 150px" data-options="editable:false">                                                 
                        </select>                                                       
                        </td>
                        <td></td>
                        <td></td>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="查询" OnClick="btnSearch_Click" />
                        </td>                   
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div style="border-left: 1px solid scrollbar;  height: 100%;">
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%" Height="100%"   SizeToReportContent="True">
            </rsweb:ReportViewer>
        </div>
    </form>
</body>
</html>
